package com.study.java.jinjie.date;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class MyDate {

    public static void main(String[] args){


        Date currentDate = new Date();



        System.out.println(currentDate);

        int i = 5;

        /*SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy");
        String formattedDate = dateFormat.format(currentDate);

        System.out.println(formattedDate);

        Calendar now = Calendar.getInstance();
        int year = now.get(Calendar.YEAR);
        System.out.println(year);
        int month = now.get(Calendar.MONTH) + 1; //Calendar.MONTH是0-11，需要加1
        int day = now.get(Calendar.DAY_OF_MONTH);
        int hour = now.get(Calendar.HOUR_OF_DAY);
        int minute = now.get(Calendar.MINUTE);
        int second = now.get(Calendar.SECOND);

        now.set(Calendar.YEAR, 2025);
        System.out.println(now.get(Calendar.YEAR));*/
    }
}
